import React, { Component, PropTypes } from 'react'
import { IconDown } from '../icon'

// todo addonBefore
// base on the input of the protosomatic input
export default class MyInput extends Component {
  render() {
    const { placeholder, classArr, addonAfter, customInputClassArr } = this.props
    const extraClass = classArr.join(' ')
    const customInputClass = customInputClassArr.join(' ')
    return (
      <div className={`cm-my-input-container ${extraClass}`}>
        {addonAfter ? addonAfter : null}
        <input className={`cm-input ${customInputClass}`} placeholder={placeholder} />
      </div>
    )
  }
}

MyInput.defaultProps = {
  classArr: [],
  customInputClassArr: [],
}

MyInput.propTypes = {
  placeholder: PropTypes.string,
  classArr: PropTypes.array,
  customInputClassArr: PropTypes.array, // 自定义`input`类名数组
  addonAfter: PropTypes.node,
}